package com.Merlin.myapplication.kotlin

fun main() {
    // 创建对象
    var p1 = Person5("Merlin")
    p1.show()
    var p2 = Person5("Merlin", 18)
    p2.show()
}

class Person5(var name: String) {
    init {
        println("init初始化")
    }

    constructor(name: String, age: Int) : this(name) {
        println("初始化")
    }

    fun show() {
        println("$name")
    }
}